package day1126;

public class demo9 {
    public static void main(String[] args) {
        int[] a={1,2,4,2,7,8,5,6};
        System.out.println(foundmax(a));
    }

    private static int foundmax(int[] a) {
        int i;
        int max=a[0];
        for(i=0;i< a.length;i++)
        {
            if(a[i]>max)
            {
                max=a[i];
            }
        }
        return max;
    }
}
